<template>
  <div class="son">
    <h2>我是son组件--{{sonCar.name}}只需{{sonCar.price}}</h2>
  </div>
</template>

<script>
import {inject} from 'vue'
export default {
  name: 'Son',
  setup(){
    let sonCar = inject('car')
    console.log("-----sonCar", sonCar)  //Proxy{}
    return {sonCar}
  }

}
</script>

<style>
.son{
  background-color: rebeccapurple;
  padding: 10px;
}
</style>
